
#ifndef _GUI_MW_H_02032013_
#define _GUI_MW_H_02032013_

#include <QMainWindow>
#include <QGridLayout>
#include <QLineEdit>
#include <QProgressBar>


namespace library { 

  class MainWindow : public QMainWindow {

      Q_OBJECT
      
   public:

    explicit MainWindow(QWidget *parent = 0);

   private slots:

    void okBtClicked();
    void activeProgressSlot();
    void waitProgressSlot();
    void shelfProgressSlot();
      
   private:

    QLineEdit *shelfSizeParam;
    QLineEdit *rCountParam;
    QLineEdit *rTimeParam;
    QLineEdit *wCountParam;
    QLineEdit *wTimeParam;

    int shelfSize;
    int readersCount;
    int readingTime;
    int writersCount;
    int writingTime;

    QProgressBar *shelfProgress;
    QProgressBar *activeProgress;
    QProgressBar *waitProgress;

    void initDefaultParams();
    void updateParam();

    void addLineEdit(QLineEdit *lineEdit, QGridLayout *gridLayout, int row, int col);
    void initProgressBar(QProgressBar *progresss, QGridLayout * gridLayout, const QString &label, int row);

  };

} // namespace library

#endif // _GUI_MW_H_02032013_
